$(document).ready(function(){
	loadTop1();
	loadTop2();
	loadTop3();
});

function loadTop1(){

	$.getJSON('function/sidebar.php?box=box1', function(data) {
		$.each(data, function(key, val) { 
			$("#top1").append("<tr><td>"+key+" ("+val+")</td><td><a href='cautare.php?judet="+key+"' class='btn btn-mini pull-right btn-info'>Vezi posturi</button></a></td></tr>");
		});
		$('#loading1').html('');
		$('#loading1').removeAttr('class');
	});
}
function loadTop2(){
		$.getJSON('function/sidebar.php?box=box2', function(data) {
	
		$.each(data, function(key, val) { 
			$("#top2").append("<tr><td>"+key+" ("+val[0]+")</td><td> <a href='cautare.php?angajator="+val[1]+
				"' class='btn btn-mini pull-right btn-info'>Vezi posturi</button></a></td></tr>");
				
		});
		$('#loading2').html('');
		$('#loading2').removeAttr('class');
	});}
function loadTop3(){
		$.getJSON('function/sidebar.php?box=box3', function(data) {
		$.each(data, function(key, val) { 
			$("#top3").append("<tr><td>"+key+" ("+val[0]+")</td><td><a href='cautare.php?post="+val[1]+"' class='btn btn-mini pull-right btn-info'>Vezi posturi</button></a></td></tr>");
		});
		$('#loading3').html('');
		$('#loading3').removeAttr('class');
	});	
}

function loadData(filter){

}